using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Domain.Model.Addresses;
using Domain.Model.BankAccounts;
using Domain.Model.Nomenclatures;
using Domain.Model.Orders;
using Domain.Model.Partners;
using Domain.Model.PhoneNumbers;

namespace Domain.Model.Partners
{
    [Serializable]
    public class Partner 
    {
        public Partner()
        {
            ID = Guid.NewGuid();
            this.BankAccounts = new HashSet<BankAccount>();
            this.Addresses = new HashSet<Address>();
            this.PhoneNumbers = new HashSet<PhoneNumber>();
            this.ContactPersons = new HashSet<ContactPerson>();
        }

        [Key]
        public Guid ID { get; set; }
        public int Code { get; set; }
        public string Name { get; set; }
        public bool IsPerson { get; set; }
        public PartnerType Type { get; set; }
        public Nullable<decimal> TotalPurchases { get; set; }
        public string FiscalCode { get; set; }
        public string VATCode { get; set; }
        public string HomePage { get; set; }
        public string Email { get; set; }
        public Nullable<System.DateTime> CreatedOn { get; set; }
        public Nullable<System.DateTime> UpdatedOn { get; set; }


        public virtual ICollection<BankAccount> BankAccounts { get; set; }
        public virtual ICollection<Address> Addresses { get; set; }
        public virtual ICollection<PhoneNumber> PhoneNumbers { get; set; }
        public virtual ICollection<ContactPerson> ContactPersons { get; set; }

    }
}
